<extend name="Public/base"/>

<block name="style">
	<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/select2/select2_metro.css" />
	<link rel="stylesheet" href="__STATIC__/plugins/data-tables/DT_bootstrap.css" />
</block>

<block name="body">

    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN EXAMPLE TABLE PORTLET-->
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="fa fa-globe"></i>[{:get_model_by_id($model_id)}] 属性列表(不含继承属性)</div>
                    <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                        <a href="#portlet-config" data-toggle="modal" class="config"></a>
                        <a href="javascript:;" class="reload"></a>
                    </div>
                </div>
                <div class="portlet-body">
                    <div class="table-toolbar">
                        <div class="btn-group">
       						<a class="btn green" href="{:U('Attribute/add?model_id='.$model_id)}">新 增</a>
                        </div>
                        <div class="btn-group pull-right">
                            <button class="btn dropdown-toggle" data-toggle="dropdown">Tools <i class="fa fa-angle-down"></i>
                            </button>
                            <ul class="dropdown-menu pull-right">
                                <li><a href="#">Print</a></li>
                                <li><a href="#">Save as PDF</a></li>
                                <li><a href="#">Export to Excel</a></li>
                            </ul>
                        </div>
                    </div>
                    <table class="table table-striped table-bordered table-hover" id="sample">
                        <thead>
                            <tr>
                                <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#sample .checkboxes" /></th>
                                <th>编号</th>
                                <th>字段</th>
                                <th>名称</th>
                                <th>数据类型</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <volist name="_list" id="vo">
                            <tr class="odd gradeX">
                                <td><input class="checkboxes ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
                                <td>{$vo.id} </td>
                                <td>{$vo.name}</td>
                                <td><a data-id="{$vo.id}" href="{:U('Attribute/edit?id='.$vo['id'])}">{$vo.title}</a></td>
                                <td><span>{:get_attribute_type($vo['type'])}</span></td>
                                <td><a href="{:U('Attribute/edit?id='.$vo['id'])}">编辑</a>
                                    <a class="confirm ajax-get" href="{:U('Attribute/remove?id='.$vo['id'])}">删除</a>
                                    </td>
                            </tr>
                            </volist>
                        </tbody>
                    </table>
                </div>
            </div>
            <!-- END EXAMPLE TABLE PORTLET-->
        </div>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script type="text/javascript" src="__STATIC__/plugins/select2/select2.min.js"></script>
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/jquery.dataTables.js"></script>
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/DT_bootstrap.js"></script>
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="__STATIC__/scripts/app.js"></script>
	<script src="__STATIC__/scripts/table-managed.js"></script>     
	<script>
		jQuery(document).ready(function() {       
		   App.init();
		   TableManaged.init();

           highlight_subnav('{:U('Model/index')}');
		});
	</script>
</block>
